#include "opencv2/opencv.hpp"

using namespace cv;

int main(void)
{
	const char *fn = "F:\\AI\\opencv\\sources\\samples\\data\\lena.jpg";
	Mat bgr = imread(fn);

	Mat bgrChannels[3], hsv, hsvChannels[3];

	imshow("source image", bgr);
	waitKey();

	split(bgr, bgrChannels);
	imshow("Blue", bgrChannels[0]);
	imshow("Green", bgrChannels[1]);
	imshow("Red", bgrChannels[2]);
	waitKey();
	
	
		
	//resize(image, image1, Size(image.cols / 2, image.rows / 2));
	//pyrDown(image1, image2);
	
	
	cvtColor(bgr, hsv, COLOR_BGR2HSV);
	split(hsv, hsvChannels);
	imshow("Hue", hsvChannels[0]);
	imshow("Saturation", hsvChannels[1]);
	imshow("Value", hsvChannels[2]);
	waitKey();


}